package com.gjw.controller;


import com.gjw.mappper.UserMapper;
import com.gjw.projo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    @Autowired
    UserMapper userMapper;

    @GetMapping("/test")
    public List test(){
        return userMapper.getAll();
    }

    @GetMapping("/add")
    public int add(){
        User user = new User();
        user.setAge(18);
        user.setName("test");
        return userMapper.addUser(user);
    }


}
